package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.Banner;
import com.ruoyi.system.mapper.ApiBannerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.service.IApiBannerService;

/**
 * banner轮播图列Service业务层处理
 * 
 * @author duantao
 * @date 2025-08-15
 */
@Service
public class ApiBannerServiceImpl implements IApiBannerService
{
    @Autowired
    private ApiBannerMapper apiBannerMapper;

    /**
     * 查询banner轮播图列
     * 
     * @param id banner轮播图列主键
     * @return banner轮播图列
     */
    @Override
    public Banner selectBannerById(Long id)
    {
        return apiBannerMapper.selectBannerById(id);
    }

    /**
     * 查询banner轮播图列列表
     * 
     * @param banner banner轮播图列
     * @return banner轮播图列
     */
    @Override
    public List<Banner> selectBannerList(Banner banner)
    {
        return apiBannerMapper.selectBannerList(banner);
    }

    /**
     * 新增banner轮播图列
     * 
     * @param banner banner轮播图列
     * @return 结果
     */
    @Override
    public int insertBanner(Banner banner)
    {
        banner.setCreateTime(DateUtils.getNowDate());
        return apiBannerMapper.insertBanner(banner);
    }

    /**
     * 修改banner轮播图列
     * 
     * @param banner banner轮播图列
     * @return 结果
     */
    @Override
    public int updateBanner(Banner banner)
    {
        banner.setUpdateTime(DateUtils.getNowDate());
        return apiBannerMapper.updateBanner(banner);
    }

    /**
     * 批量删除banner轮播图列
     * 
     * @param ids 需要删除的banner轮播图列主键
     * @return 结果
     */
    @Override
    public int deleteBannerByIds(Long[] ids)
    {
        return apiBannerMapper.deleteBannerByIds(ids);
    }

    /**
     * 删除banner轮播图列信息
     * 
     * @param id banner轮播图列主键
     * @return 结果
     */
    @Override
    public int deleteBannerById(Long id)
    {
        return apiBannerMapper.deleteBannerById(id);
    }
}
